/////////////////////////////////////////////////////////////////////////////
// Purpose:     Additional useful base types
// Author:      Jesus Gonzalez
// Modified by:
// Copyright:   (c) 2003-2013 Jesus Gonzalez <jgonzalez@gdr-sistemas.com>
// License:     BSD License
/////////////////////////////////////////////////////////////////////////////

#ifndef _SMARTLIB_EXTENDEDTYPES_H_
#define _SMARTLIB_EXTENDEDTYPES_H_

/**
 * \file
 * Additional useful base types.
 */

#include <limits.h>

//
// Extended types definitions
//

typedef unsigned char		byte;
typedef unsigned int		uint;

typedef unsigned char		uint8;
typedef char				int8;
typedef unsigned short		uint16;
typedef short				int16;
typedef unsigned long		uint32;
typedef long 				int32;
typedef unsigned long long	uint64;
typedef long long			int64;

#ifndef __cplusplus
typedef long 						bool;
#define false 0
#define true  !false
#endif

//
// Extended types limits
//

#define BYTE_MAX UCHAR_MAX
#define BYTE_MIN 0

#define USHORT_MAX USHRT_MAX

#define UINT8_MAX UCHAR_MAX
#define UINT16_MAX USHRT_MAX
#define UINT32_MAX ULONG_MAX

#define INT8_MAX CHAR_MAX
#define INT16_MAX SHRT_MAX
#define INT32_MAX LONG_MAX

#define INT8_MIN CHAR_MIN
#define INT16_MIN SHRT_MIN
#define INT32_MIN LONG_MIN

#endif // _SMARTLIB_EXTENDEDTYPES_H_
